import React, { Component } from 'react'
import { Taro, getCurrentInstance } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import './index.less'
import Query from './components/query'
import { connect } from 'react-redux'
@connect(({test})=>({test}))
export default class Index extends Component {
  state = {
    type: 'type-son'
  }
  componentWillMount() { }

  componentDidMount() {

  }

  componentWillUnmount() { }

  componentDidShow() { }

  componentDidHide() { }
  onLoad(options) {
    console.log(options);
    console.log(getCurrentInstance().router.params)
  }

  render() {
    const { type } = this.state
    return (
      <View id='#the-id'>
        <Text ref='textRef'>Hello Text{getCurrentInstance().router.params.id}性别：{this.props.test.sex}</Text>
        <View>
          <Query type={type}></Query>
        </View>
      </View>
    )
  }
}
